package cn.iocoder.yudao.module.erp.dal.mysql.bom;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.dal.dataobject.bom.ErpBomDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.erp.controller.admin.bom.vo.*;

/**
 * bom Mapper
 *
 * @author lekaihuai
 */
@Mapper
public interface ErpBomMapper extends BaseMapperX<ErpBomDO> {

    default PageResult<ErpBomDO> selectPage(ErpBomPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ErpBomDO>()
                .eqIfPresent(ErpBomDO::getFnumber, reqVO.getFnumber())
                .eqIfPresent(ErpBomDO::getUpdater, reqVO.getUpdater())
                .betweenIfPresent(ErpBomDO::getUpdateTime, reqVO.getUpdateTime())
                .eqIfPresent(ErpBomDO::getFunitid, reqVO.getFunitid())
                .likeIfPresent(ErpBomDO::getFname, reqVO.getFname())
                .eqIfPresent(ErpBomDO::getFbomtype, reqVO.getFbomtype())
                .eqIfPresent(ErpBomDO::getFproductqty, reqVO.getFproductqty())
                .eqIfPresent(ErpBomDO::getFusagetype, reqVO.getFusagetype())
                .eqIfPresent(ErpBomDO::getFmaterialid, reqVO.getFmaterialid())
                .eqIfPresent(ErpBomDO::getFmodel, reqVO.getFmodel())
                .eqIfPresent(ErpBomDO::getFyield, reqVO.getFyield())
                .eqIfPresent(ErpBomDO::getFmaterialplanid, reqVO.getFmaterialplanid())
                .eqIfPresent(ErpBomDO::getFbomgroupid, reqVO.getFbomgroupid())
                .eqIfPresent(ErpBomDO::getFpicturenumber, reqVO.getFpicturenumber())
                .orderByAsc(ErpBomDO::getFid));
    }

}